<template>
    <a-card :bordered="false">
        <LTable
        ref="KhyUserCouponListTable"
        size="middle"
        rowKey="keyId"
        :formAttributes="formAttributes"
        :columns="columns"
        axiosUrl="/KhyUserCouponController/page"
        :showPagination="true"
        :showQueryForm="true"
        :initOrder="initOrder"
      >
    </LTable>
    </a-card>
</template>

<script>
import LTable from '@/components/lt/LTable'
import {SysMixin} from '@/mixins/SysMixin'
import defaultSettings from '@/config/defaultSettings'
export default {
    name:'KhyUserCouponList',
    components:{
       LTable
    },
    mixins:[SysMixin],
    data(){
        return{
            initDictCodes:defaultSettings.数据字典.优惠卷类型+','+defaultSettings.数据字典.是否+','+defaultSettings.数据字典.优惠卷状态,
            defaultSettings,
            initOrder:[{field:'endDate',val:'desc'}],
            formAttributes:[
                {field:'couponName',label:'优惠券名称',component:'input',condition:'like'},
                {field:'userNo',label:'用户手机号',component:'input',condition:'like'},
                {field:'couponType',label:'优惠券类型',component:'select',condition:'eq',dictCode:defaultSettings.数据字典.优惠卷类型,},
                {field:'couponStatus',label:'优惠卷状态',component:'select',condition:'eq',dictCode:defaultSettings.数据字典.优惠卷状态,},
                {field:'createTime',label:'发放日期',component:'time',condition:'between'},
                {field:'endDate',label:'截止日期',component:'time',condition:'between'},
            ],
         
            columns:[
                {
                    title: '序号',
                    dataIndex: '',
                    key:'rowIndex',
                    width:60,
                    align:"center",
                    customRender:function (t,r,index) {
                      return parseInt(index)+1;
                    }
                },
                
                {
                    title: '用户手机号',
                    dataIndex: 'userNo'
                },
                 {
                    title: '优惠券名称',
                    dataIndex: 'couponName'
                },
                {
                    title: '优惠金额',
                    dataIndex: 'couponValue'
                    
                },
                {
                    title: '优惠券类型',
                    dataIndex: 'couponType',
                    customRender:(text)=>{
                        if(!text){
                            return ''
                        }else{
                            return this.dictText(defaultSettings.数据字典.优惠卷类型,text)
                        }
                    }
                },
                {
                    title: '截止日期',
                    dataIndex: 'endDate',
                },
                {
                    title: '发放日期',
                    dataIndex: 'createTime',
                },
                
                {
                    title: '优惠卷状态',
                    dataIndex: 'couponStatus',
                    customRender:(text)=>{
                        if(!text){
                            return ''
                        }else{
                            return this.dictText(defaultSettings.数据字典.优惠卷状态,text)
                        }
                    }
                },
            
            ],
            
        }
    },
    created(){
       
    },
    methods:{
       
    }
}
</script>